package cn.the.angry.physics;

import org.jbox2d.collision.shapes.CircleDef;
import org.jbox2d.collision.shapes.ShapeType;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.World;

import cn.the.angry.model.Actor;

public class AngryCircle extends AngryShape {	
	private CircleDef circleDef;
	
	public AngryCircle(World world, float _x, float _y, float _density, float _friction
					   , float _restitution, float _radius, final Actor actor) {
		super();
		circleDef = new CircleDef();
		circleDef.density = _density;
		circleDef.friction = _friction;
		circleDef.restitution = _restitution;
		circleDef.radius = _radius;
		bodyDef.position.x = _x;
		bodyDef.position.y = _y;
	
		body = world.createBody(bodyDef);
		try {
			body.createShape(circleDef);
			body.setUserData(actor);
			body.setMassFromShapes();
		} catch (Exception e) {
		}
	}
	
	
	public void setCircleDef(CircleDef circleDef) {
		this.circleDef = circleDef;
	}

	public CircleDef getCircleDef() {
		return circleDef;
	}
	
	

}
